#!/bin/sh
# To run `jdb` instead of `java` set JAVA=jdb
# To run under gdb, set JAVA='gdb --args java'
arg=`echo "$1"|sed 's!.*/!!;s!\.class$!!'`
# Use libtool's -dlopen option to ensure that libxapian_jni.so (or whatever)
# is in the shared library path.
${LIBTOOL-../libtool} --config > libtoolconfig.$$
. ./libtoolconfig.$$
rm -f libtoolconfig.$$
${LIBTOOL-../libtool} -dlopen libxapian_jni.la --mode=execute \
  $OSX_SIP_HACK_ENV ${JAVA-java} -Djava.library.path="$objdir" -classpath built/xapian.jar${PATHSEP-:}. "$arg"
